package com.mspbots.core.ticketai.model;

import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * com.mspbots.sync.model.TicketOnly
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/11/22
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TicketOnly {

    private Long id;
    private Long cwId;
    private Long tenantId;
    private Long boardId;
    private Long statusId;
    private Integer priorityId;
    private Integer companyId;
    private Integer contactId;
    private String status;
    private String summary;
    private String resources;
    private String contactName;
    private JsonNode auditor;
    private JsonNode extend;
    private JsonNode teamRoles;
    private JsonNode companyExtend;
    private Long companyStatusId;
    private Long owner;
    private String companyStatusName;

    private LocalDateTime createdTime;
    private LocalDateTime updatedTime;

    private transient Double billAmount;
    private transient String contactTitle;

    private transient String priorityName;
    private transient String companyName;

    private String recordType;
    private String subBillingMethod;
    private String locationName;
    private String updatedBy;
    private Integer dataTotal;

    private List<TicketSchedule> ticketScheduleList;

    public void addTicketScheduleList(TicketSchedule ticketSchedule) {
        if (this.ticketScheduleList == null) {
            this.ticketScheduleList = new ArrayList<>();
        }
        this.ticketScheduleList.add(ticketSchedule);
    }
}
